<div>
    <div ng-if="!vm.hasPermissionMarketing">
        您无权访问此页面！
    </div>
    <div ng-if="vm.hasPermissionMarketing">
        <div class="row">
            <div class="col-sm-3">
                <div ng-click="vm.currentBanner = {isNew:true,typeModel:vm.bannerTypes[0]};">新建</div>
                <div ng-repeat="ban in vm.banners" ng-click="vm.currentBanner = ban">
                    {{ban.title}}
                </div>
            </div>
            <div class="col-sm-9">
                <input type="text" ng-model="vm.currentBanner.title">
                <input type="text" ng-model="vm.currentBanner.subtitle">
                <select ng-model="vm.currentBanner.typeModel"  ng-options="t.text for t in vm.bannerTypes" ng-init="vm.currentBanner.typeModel=vm.currentBanner.typeModel||vm.bannerTypes[0]">
                </select>
                <input type="text" ng-model="vm.currentBanner.value">
                <a ng-click="vm.saveBanner()">{{vm.currentBanner.isNew?'新建':'修改'}}</a>
                <a ng-click="vm.removeBanner()" ng-show="!vm.currentBanner.isNew">删除</a>
                <br>
                <div ng-show="vm.currentBanner.image != undefined">
                    <img  ng-src="{{vm.currentBanner.image.url}}">
                    <a ng-click="vm.removeBannerImage()">移除图片</a>
                </div>
                <br>

                <div ng-show="!vm.currentBanner.isNew">
                    <ng-include  src="'/template/component/UploadFile.html'"></ng-include>
                    <a ng-click="vm.setBannerImage()">设置图片</a>
                </div>
            </div>
        </div>

    </div>
</div>